<uni-forms-item name="name" label="商户名称" required>
  <uni-easyinput placeholder="商户名称" v-model="formData.name" trim="both"></uni-easyinput>
</uni-forms-item>
<!-- 添加Logo上传 -->
<uni-forms-item name="logo" label="商户Logo">
  <uni-file-picker 
    v-model="formData.logo" 
    file-mediatype="image"
    mode="grid"
    :auto-upload="true"
    limit="1"
    @select="selectLogo"
    @success="uploadSuccess"
    @fail="uploadFail"
  ></uni-file-picker>
</uni-forms-item>
<uni-forms-item name="phone" label="联系电话">
  <uni-easyinput placeholder="联系电话" v-model="formData.phone" trim="both"></uni-easyinput>
</uni-forms-item>

let formData = {
  "tenant_id": "",
  "name": "",
  "logo": "",
  "phone": "",
  "address": "",
  "status": 1,
}

methods: {
  // 图片选择事件
  selectLogo(e) {
    console.log('选择文件：', e)
  },
  
  // 上传成功
  uploadSuccess(e) {
    console.log('上传成功：', e)
    // 获取上传后的图片URL
    if (e.tempFilePaths && e.tempFilePaths.length > 0) {
      this.formData.logo = e.tempFilePaths[0]
    } else if (e.tempFiles && e.tempFiles.length > 0 && e.tempFiles[0].url) {
      this.formData.logo = e.tempFiles[0].url
    }
  },
  
  // 上传失败
  uploadFail(e) {
    console.error('上传失败：', e)
    uni.showToast({
      title: '图片上传失败',
      icon: 'none'
    })
  },
  
  /**
   * 验证表单并提交
   */
} 